#include<iostream>
#include<vector>

using namespace std;
vector<vector<int> > rotateMatrix(vector<vector<int> >& mat, int n)
{
	int x = mat.size();
	if (x < 1) return mat;
	for (int i = 0; i < n; i++)
		for (int j = i + 1; j < n; j++)
			swap(mat[i][j], mat[j][i]);
	for (int i = 0; i < n; i++)
		reverse(mat[i].begin(), mat[i].end());
	return mat;
}



int main()
{
	vector<vector<int>> mat = { {1,2,3},{4,5,6},{7,8,9} };
	rotateMatrix(mat, 3);
	return 0;
}